﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
using System.IO.Ports;
using TCA_User.Common;
using TCA_User.Tab_Class;

namespace TCA_User
{
    public partial class Bill_List
    {
        private System.Windows.Forms.TabPage Common_Info_Tab;

        private Gridview_Grp Taxi_TBL_Form;
        private Gridview_Grp Account_TBL_Form;
        private Gridview_Grp Department_TBL_Form;
        private Gridview_Grp Permission_TBL_Form;
        private Gridview_Grp CardGroup_TBL_Form;

        public bool Init_CommonInfo_Tab()
        {
            PosSize possize = new PosSize(); ;
            string tab_name = "Common_Info";
            Common_Info_Tab = new System.Windows.Forms.TabPage();
            // Common_Info_Tab = new System.Windows.Forms.TabPage();
            Common_Info_Tab.Text = tab_name;
            Common_Info_Tab.SuspendLayout();
            Common_Info_Tab.Location = new System.Drawing.Point(4, 22);
            Common_Info_Tab.Size = new System.Drawing.Size(900, 390);
            Common_Info_Tab.Padding = new System.Windows.Forms.Padding(3);
            Common_Info_Tab.TabIndex = 2;
            Common_Info_Tab.UseVisualStyleBackColor = true;
            Common_Info_Tab.ResumeLayout(true);
            Common_Info_Tab.PerformLayout();
            this.MainTabControl.Controls.Add(this.Common_Info_Tab);

            // Init Taxi_TBL
            possize.pos_x = 10;
            possize.pos_y = 6;
            possize.width = 220;
            possize.height = 180;
            Taxi_TBL_Form = new Gridview_Grp(Common_Info_Tab, "Taxi", possize, NO_AUTO_RESIZE,
                                                TCA_Database_Conn, @"SELECT * FROM dbo.[Taxi_TBL]", AnchorType.LEFT);

            // Init Card Group
            possize.pos_x = 10;
            possize.pos_y = 200;
            possize.width = 220;
            possize.height = 500;
            CardGroup_TBL_Form = new Gridview_Grp(Common_Info_Tab, "Card Group", possize, NO_AUTO_RESIZE,
                                                TCA_Database_Conn, @"SELECT * FROM dbo.[CardGroup_TBL]", AnchorType.LEFT);

            // Init Permission
            possize.pos_x = 250;
            possize.pos_y = 6;
            possize.width = 220;
            possize.height = 180;
            Permission_TBL_Form = new Gridview_Grp(Common_Info_Tab, "Permission", possize, NO_AUTO_RESIZE,
                                                TCA_Database_Conn, @"SELECT * FROM dbo.[Permission_TBL]", AnchorType.LEFT);
            Permission_TBL_Form.dataGridView_View.AllowUserToAddRows = false;
            Permission_TBL_Form.dataGridView_View.AllowUserToDeleteRows = false;
            Permission_TBL_Form.Enabled = false;


            // Init Department_TBL
            possize.pos_x = 250;
            possize.pos_y = 200;
            possize.width = 220;
            possize.height = 500;
            Department_TBL_Form = new Gridview_Grp(Common_Info_Tab, "Department", possize, NO_AUTO_RESIZE,
                                                TCA_Database_Conn, @"SELECT * FROM dbo.[DEPART_LIST]", AnchorType.LEFT);

            

            // Init Account
            possize.pos_x = Common_Info_Tab.Size.Width - 410;
            possize.pos_y = 6;
            possize.width = 650;
            possize.height = 700;
            Account_TBL_Form = new Gridview_Grp(Common_Info_Tab, "Account", possize, NO_AUTO_RESIZE,
                                                TCA_Database_Conn, @"SELECT * FROM dbo.[Account_TBL]", AnchorType.LEFT);
            return true;
        }
    }
}